/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ucjava.chat.commserve.tonys.server;

import javax.annotation.Resource;
import javax.jws.WebService;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.xml.ws.WebServiceContext;

/**
 *
 * @author tony
 */
@WebService(serviceName = "ServerTest")
public class ServerTest
{

      @Resource
  private WebServiceContext wsContext;
    /**
     * This is a sample web service operation
     */
    @WebMethod(operationName = "hello")
    public String hello(@WebParam(name = "name") String txt)
    {
        return "Hello " + txt + " !";
    }
    @WebMethod
    public String namingNames()
    {
        String resp = wsContext.getUserPrincipal().getName();
        System.out.println("Username = " + resp);
        return resp;
    }
}
